package com.gzedu.module.dao.curd.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Repository;

import com.gzedu.common.sys.dao.impl.BaseDao;
import com.gzedu.module.dao.curd.ICurdListDao;
import com.gzedu.module.modle.curd.CurdList;

@Repository
public class CurdListDaoImpl extends BaseDao<CurdList> implements ICurdListDao{

	@Resource
    private SqlSessionFactory sqlSessionFactory;  
  
	public SqlSessionFactory getSqlSessionFactory() {
		return sqlSessionFactory;
	}

	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		this.sqlSessionFactory = sqlSessionFactory;
	}
	
	public List<CurdList> selectByFormId(CurdList curdList) {
		// TODO Auto-generated method stub
		return sqlSessionFactory.openSession().selectList(super.getStatement()+".selectByFormId",curdList);
	}

	public List<CurdList> getByListId(CurdList curdList) {
		// TODO Auto-generated method stub
		return sqlSessionFactory.openSession().selectList(super.getStatement()+".getByListId", curdList);
	}

	public int deleteByFormId(CurdList curdList) {
		// TODO Auto-generated method stub
		return sqlSessionFactory.openSession().delete(getStatement()+".deleteByFormId", curdList);
	}

}
